
import React, { useState } from "react";
import { Link } from "react-router-dom";
import { Tooltip } from "antd";
import Earth3d from "../../components/earth3d";
import { INDEX } from '../../routes';
import { port } from "../../assets/global";
import style from "./index.module.css";
import returnSvg from "../../assets/images/full-screen-exit.svg";

function FullScreen(props){
    let [harbor, setHarhor] = useState("");
    return (
        <div className={style["container"]}>
            <Earth3d destinationPort={ (portName) => { setHarhor(portName ? port[portName].alias : "") } } />
            <Link to={ INDEX }>
                <Tooltip placement="left" title={ "退出全屏" }>
                    <img src={returnSvg} alt="退出全屏" className={style["exit-icon"]} />
                </Tooltip>
            </Link>
            <div className={style["title"]} >{harbor}</div>
        </div>
    );
}

export default FullScreen;